﻿using SanJ.FreeCare.ValueSets;
using System;
using System.Collections.Generic;
using System.Data.Common;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Domain.Values;

namespace SanJ.FreeCare.TypeFramework
{
    public class Identifier : ValueObject
    {
        /// <summary>
        /// IdentifierUse usual | official | temp | secondary | old (If known)
        /// </summary>
        public string Use { get; set; }

        /// <summary>
        /// Description of identifier
        /// </summary>
        public string Type { get; set; }

        /// <summary>
        /// The namespace for the identifier value
        /// </summary>
        public string System { get; set; }

        /// <summary>
        /// The value that is unique
        /// </summary>
        public string Value { get; set; } //hisnumber


        public Identifier()
        {

        }

        public Identifier(string type, string value)
        {
            this.Type = type;
            this.Value = value;
            this.Use = IdentifierUse.Usual;
        }

        public Identifier(string system, string value, string use)
        {
            System = system;
            Value = value;
            Use = use;
        }

        protected override IEnumerable<object> GetAtomicValues()
        {
            yield return Use;
            yield return Type;
            yield return System;
            yield return Value;

        }
    }
}
